package quick.api.app.service.article;

import com.alibaba.fastjson.JSONObject;
import quick.api.app.util.FormatArticleData;
import webdm.business.bean.Context;
import webdm.business.bean.ResponseDTO;
import webdm.business.component.AbstractPipelineComponent;
import webdm.business.util.ValueUtil;

import java.util.List;

public class FormatArticle extends AbstractPipelineComponent {

    @Override
    public ResponseDTO process(Context context) {

        Object obj = ValueUtil.getValue(source, null, context.getParams());

//        Object obj = context.get("blog.article");
        if (obj != null && obj instanceof JSONObject) {
            FormatArticleData.formatArticle((JSONObject)obj);
        }
        return ResponseDTO.getSuccessInstance();
    }
}
